package com.ruoyi.ams.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.ams.mapper.AmsAssetProjectMapper;
import com.ruoyi.ams.service.IAmsAssetProjectService;
import com.ruoyi.common.core.domain.model.AmsAssetProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资产批次信息Service业务层处理
 * 
 * @author yfkj
 * @date 2021-10-15
 */
@Service
public class AmsAssetProjectServiceImpl extends ServiceImpl<AmsAssetProjectMapper, AmsAssetProject>  implements IAmsAssetProjectService
{
    @Autowired
    private AmsAssetProjectMapper amsAssetProjectMapper;

    /**
     * 查询资产批次信息
     * 
     * @param projectId 资产批次信息主键
     * @return 资产批次信息
     */
    @Override
    public AmsAssetProject selectAmsAssetProjectByProjectId(Long projectId)
    {
        return amsAssetProjectMapper.selectAmsAssetProjectByProjectId(projectId);
    }

    /**
     * 查询资产批次信息列表
     * 
     * @param amsAssetProject 资产批次信息
     * @return 资产批次信息
     */
    @Override
    public List<AmsAssetProject> selectAmsAssetProjectList(AmsAssetProject amsAssetProject)
    {
        return amsAssetProjectMapper.selectAmsAssetProjectList(amsAssetProject);
    }

    /**
     * 新增资产批次信息
     * 
     * @param amsAssetProject 资产批次信息
     * @return 结果
     */
    @Override
    public int insertAmsAssetProject(AmsAssetProject amsAssetProject)
    {
        amsAssetProject.setCreateTime(System.currentTimeMillis());
        return amsAssetProjectMapper.insertAmsAssetProject(amsAssetProject);
    }

    /**
     * 修改资产批次信息
     * 
     * @param amsAssetProject 资产批次信息
     * @return 结果
     */
    @Override
    public int updateAmsAssetProject(AmsAssetProject amsAssetProject)
    {
        amsAssetProject.setUpdateTime(System.currentTimeMillis());
        return amsAssetProjectMapper.updateAmsAssetProject(amsAssetProject);
    }

    /**
     * 批量删除资产批次信息
     * 
     * @param projectIds 需要删除的资产批次信息主键
     * @return 结果
     */
    @Override
    public int deleteAmsAssetProjectByProjectIds(Long[] projectIds)
    {
        return amsAssetProjectMapper.deleteAmsAssetProjectByProjectIds(projectIds);
    }

    /**
     * 删除资产批次信息信息
     * 
     * @param projectId 资产批次信息主键
     * @return 结果
     */
    @Override
    public int deleteAmsAssetProjectByProjectId(Long projectId)
    {
        return amsAssetProjectMapper.deleteAmsAssetProjectByProjectId(projectId);
    }
}
